<!--<template>-->
<!--  <div>-->
<!--    <el-pagination-->
<!--        v-bind="$attrs"-->
<!--        v-on="$listeners"-->
<!--        :background="preferences.PaginationBackground"-->
<!--        :layout="preferences.TableLayout"-->
<!--    >-->
<!--      <template slot="default" v-if="$slots['default']">-->
<!--        <slot name="default"></slot>-->
<!--      </template>-->

<!--    </el-pagination>-->
<!--    {{currentPage}}-->
<!--  </div>-->

<!--</template>-->

<script>
import preferences from "@/MUI/config/preferences";
import ElPagination from "element-ui/packages/pagination/src/pagination";
export default {
  name: "MPagination",
  data() {
    return {};
  },
  extends: ElPagination,
  components: {},
  props: {
    background: {
      default: preferences.PaginationBackground,
    },
    layout: {
      default: preferences.TableLayout,
    },
  },
  watch: {
    // currentPage: {
    //   handler(page) {
    //     console.log(1, page, preferences.TableLayout);
    //   },
    //   immediate: true,
    // },
    total: {
      handler(total) {
        var page = this.$m.getPage(this.currentPage, this.pageSize, total);
        if (this.currentPage !== page) {
          this.handleCurrentChange(page);
        }
      },
      immediate: true,
    },
  },
  mounted() {},
  methods: {},
};
</script>

<style lang="scss" scoped></style>
